EMT Practice Test

1. Question Content...


Question List

Question1: Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permission for the currently logged-in user while using the custom search tool?

Question2: Einstein Next Best Action Is configured at Universal Containers to display recommendations to internal users on the Account detail page.
If the recommendation is approved, a new opportunity record and task should be generated. If the recommendation is rejected, an Apex method must be executed to perform a callout to an external system.
Which three factors should a developer keep Hi mind when implementing the Apex method?
Choose 3 answers

Question3: Which scenario is valid for execution by unit tests?

Question4: Universal Container is building a recruiting app with an Applicant object that stores information about an individual person that represents a job. Each application may apply for more than one job.
What should a developer implement to represent that an applicant has applied for a job?

Question5: A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of the new Apex helper class.
Change Set deployment to production fails with the test coverage warning:
"Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required." What should the developer do to successfully deploy the new Apex trigger and helper class?

Question6: The following Apex method is part of the ContactServiceclass that is called from a trigger:

How should the developer modify the code to ensure best practices are met?

Question7: A developer must create a Lightning component that allows users to input Contact record information to create a Contact record, including a Salary__ccustom field.
What should the developer use, along with a lightning-record-edit-form, so that Salary__cfield functions as a currency input and is only viewable and editable by users that have the correct field level permissions on Salary__c?

Question8: Which option should a developer use to create 500 Accounts and make sure that duplicates are not created for existing Account Sites?

Question9: A visualforce interface is created for Case Management that includes both standard and custom functionality defined in an Apex class called myControllerExtension. The visualforce page should include which
<apex:page> attribute(s) to correctly implement controller functionality?

Question10: What is the order of operations when a record is saved in Salesforce?

Question11: A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Whithin the class, the developer identifies the following method as a security threat:
List<Contact> performSearch(String lastName){ return Database.query('Select Id, FirstName, LastName FROM Contact WHERE LastName Like %'+lastName+'%); } What are two ways the developer can update the method to prevent a SOQL injection attack? Choose 2 answers

Question12: A developer needs to create an audit trail for records that are sent to the recycle bin. Which type of trigger is most appropriate to create?

Question13: A developer has the controller class below.

Which code block will run successfully in an execute anonymous window?
myFooController m = new myFooController();

Question14: A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown.
Which step should the developer take to resolve the issue and properly test the exception?

Question15: Which statement is true about a hierarchical relationship as it pertains to user records?

Question16: A developer writes the following code:

What is the result of the debug statement?

Question17: Universal Containers (UC) decided it will not send emails to support personnel directly from Salesforce in the event that an unhandled exception occurs. Instead, UC wants an external system be notified of the error.
What is the appropriate publish/subscribe logic to meet these requirements?

Question18: Which control statement should a developer use to ensure that a loop body executes at least once?

Question19: What are three characteristics of change set deployments? (Choose three.)

Question20: Universal Containers has a Visualforce page that displays a table of every Container_c. being ....... Is falling with a view state limit because some of the customers rent over 10,000 containers.
What should a developer change about the Visualforce page to help with the page load errors?

Question21: Which two statements are true about Apex code executed in Anonymous Blocks? (Choose two.)

Question22: How many accounts will be inserted by the following block ofcode? for(Integer i = 0 ; i <
500; i++) { Account a = new Account(Name='New Account ' + i); insert a; }
* 0
87. Boolean odk;
Integer x;
if(abok=false;integer=x;){
X=1;
}elseif(abok=true;integer=x;){
X=2;
}elseif(abok!=null;integer=x;){
X=3;
)elseif{
X=4;}

Question23: Which control statement should a developer use to ensure that a loop body executes at least once?

Question24: What is an important consideration when developing in a multi-tenant environment?

Question25: What is a benefit of using a trigger framework?

Question26: When the value of a field of an account record is updated, which method will update the value of a custom field opportunity? Choose 2 answers.

Question27: Which two are best practices when it comes to component and application event handling? (Choose two.)

Question28: Which feature allows a developer to create test records for use in test classes?

Question29: What is the result of the debug statements in testMethod3 when you create test data using testSetup in below code?

Question30: A developer has the controller class below.

Which code block will run successfully in an execute anonymous window?

Question31: Which three data types can be returned from an SOQL statement?

Question32: Which type of information is provided by the Checkpoints tab in the Developer Console? (Choose 2)

Question33: Which two statements are true about Getter and Setter methods as they relate to Visualforce?

Question34: As part of a data cleanup strategy, AW Computing wants to proactively delete associated opportunity records when the related Account is deleted.
Which automation tool should be used to meet this business requirement?

Question35: What is the result of the debug statements in testMethod3 when you create test data using testSetup in below code?

Question36: Which two operations can be performed using a formula field? Choose 2 answers

Question37: Which code segment can be used to control when the dowork() method is called?

Question38: A Visual force page displays two fields named Phone Number and Email.User1 has access to Phone Number, but not to Email.User2 has access to Email, but not Phone NumberA developer needs to ensure that User1 can only see Phone Number, and User2 can only see Email.Which method can the developer use to achieve this?

Question39: Universal Containers has a support process that allows users to request support from its engineering team using a custom object, Engineering_Support__c.
Users should be able to associate multiple engineering_Support__c records to a single Opportunity record.
Additionally, aggregate Information about the Engineering_support__c records should be shown on the Opportunity record.
What should a developer Implement to support these requirements?

Question40: A developer uses a loop to check each Contact in a list. When a Contact with the Title of 'Boss' is found, the Apex method should jump to the first line of code outside of the for loop.
Which Apex solution will let the developer implement this requirement?

Question41: A developer needs to implement a custom SOAP Web Service that is used by an external Web Application. The developer chooses to Include helper methods that are not used by the Web Application In the Implementation of the Web Service Class.
Which code segment shows the correct declaration of the class and methods?
A)

B)

C)

D)

Question42: In the Lightning UI, where should a developer look to find information about a Paused Flow Interview?

Question43: Which Apex collection is used to ensure that all values are unique?

Question44: What are the supported content sources for custom buttons and links? (Choose 2 Answers)

Question45: A developer executes the following query in Apex to retrieve a list of contacts for each account:
List<account> accounts = [Select ID, Name, (Select ID, Name from Contacts) from Account] ; Which two exceptions may occur when it executes? (Choose two.)

Question46: Which three tools can deploy metadata to production? (Choose three.)

Question47: Which two queries can a developer use in a Visualforce controller to protect against SOQL injection vulnerabilities? Choose 2 answers

Question48: A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. public class without sharing OpportunityService( public static List<OpportunityLineItem> getOpportunityProducts(Set<Id> opportunityIds){ List<OpportunitylineItem> oppLineItems = new List<OpportunityLineItem>(); for(Id thisOppId : opportunityIds){ oppLineItems.addAll([Select Id FROM OpportunityLineItems WHERE OpportunityId = :thisOppId)]; } return oppLineItems; } } The above method might be called during a trigger execution via a Lightning component. Which technique should be implemented to avoid reaching the governor limit?

Question49: A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of test allowing them to test independent requirements various types of Salesforce Cases.
Which approach can efficiently generate the required data for each unit test?

Question50: The following automations already exist on the Account object;
* A workflow rule that updates a field when a certain criteria is met
* A custom validation on a field
* A How that updates related contact records
A developer created a trigger on the Account object.
What should the developer consider while testing the trigger code?

Question51: A developer working on a time management application wants to make total hours for each timecard available to application users. A timecard entry has a Master-Detail relationship to a timecard.
Which approach should the developer use to accomplish this declaratively?

Question52: What is the maximum number of SOQL queries used by the following code? List<Account> aList =
[SELECT Id FROM Account LIMIT 5]; for (Account a : aList){ List<Contact> cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id); }

Question53: How many levels of child records can be returned in a single SOQL query from one parent object?

Question54: On which object can an administrator create a roll-up summary field?

Question55: A developer created a lightning component name accountList.cmp that display a list of Accounts. Client-side logic that is executed when a user hovers over an account in the list should be stored in which bundle member?

Question56: An Apex method, getAccounts, that returns a List of Accounts given a searchTerm, is available for Lightning Web components to use.
What is the correct definition of a Lightning Web component property that uses the getAccounts method?

Question57: What is a valid statement about Apex classes and interfaces? Choose 2 answers:

Question58: Which two are phases in the Salesforce Application Event propagation framework? (Choose two.)

Question59: What are the eight officially supported languages on Heroku platform?

Question60: A company has a custom object named Region. Each Account in Salesforce can only be related to one Region at a time, but this relationship is optional.
Which type of relationship should a developer use to relate an Account to a Region?

Question61: A developer created a trigger on the Account object and wants to test if the trigger is properly bulklfield. The developer team decided that the trigger should be tested with 200 account records with unique names.
What two things should be done to create the test data within the unit test with the least amount of code? Choose 2 answers A developer created a trigger on the Account object and wants to test if the trigger is properly bulklfield. The developer team decided that the trigger should be tested with 200 account records with unique names.
What two things should be done to create the test data within the unit test with the least amount of code?
Choose 2 answers

Question62: Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a Master- Detail relationship with the standard Account object. Based on some internal discussion, the UC administrator tried to change the Master-Detail relationship to a Lookup relationship but was not able todo so. What is apossible reason that this change was not permitted?

Question63: Which three web technologies can be integrated into a Visualforce page? (Choose three.)

Question64: When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs?

Question65: Universal Containers has large number of custom applications that were built using a third-party javaScript framework and exposed using Visualforce pages. The Company wants to update these applications to apply styling that resembles the look and feel of Lightning Experience. What should the developer do to fulfill the business request in the quickest and most effective manner?

Question66: A developer must create a Lightning component that allows user to input Contact record information to create a Contact record, including a Salary__c custom field. What should the developer use, along with a lightning-record-edit-form, so that Salary__c field functions as a currency input and is only viewable and editable by users that have the correct field level permissions on Salary__c?

Question67: Which two components are available to deploy using the Metadata API? (Choose two.)

Question68: How should a custom user interface be provided when a user edits an Account in Lightning Experience?

Question69: A developer wants to display all of the available record types for a Case object. The developer also wants to display the picklist values for the Case.Status field. The Case object and the Case.Status field are on a custom Visualforce page. Which action can the developer perform to get the record types and picklist values in the controller? (Choose 2)

Question70: Which two Apex data types can be used to reference a Salesforce record ID dynamically? (Choose two.)

Question71: Which three data types can be returned from an SOQL statement? (Choose three.)

Question72: What are three ways for a developer to execute tests in an org? Choose 3.

Question73: A developer wants to retrieve the Contacts and Users with the email address '[email protected]'.
Which SOSL statement should the developer use?

Question74: Universal Containers stores the availability date on each Line Item of an Order and Orders are only shipped when all of the Line Items are available.
Which method should be used to calculate the estimated ship date for an Order?

Question75: How can a developer get all of the available record types for the current user on the case object?

Question76: A Hierarchy Custom Setting stores a specific URL for each profile in Salesforce. Which statement can a developer use to retrieve the correct URL for the current user'sprofile and display this on a Visualforce Page?

Question77: A developer must provide a custom user interface when users edit a Contact. Users must be able to use the interface in Salesforce Classic and Lightning Experience. What should the developer do to provide the custom user interface?

Question78: A developer created a Visualforce page with a custom controller to show a list of accounts. The page uses the
<apex:SelecList> component, with a variable called "selection", to show the valid values for Account.Type.
The page uses an <apex:pageBlockTable> component to display the list of accounts, where the iteration variable is "acct". The developer wants to ensure that when a user selects a type on the <apex : selectList> component, only accounts with that type are shown on the page. What should the developer do to accomplish this?

Question79: Which statement should a developer avoid using inside procedural loops? (Choose 2)

Question80: A developer has thecontroller class below.

Which code block will run successfully in an execute anonymous window?

Question81: What should be used to create scratch orgs?

Question82: A developer has the following trigger that fires after insert and creates a child Case whenever a new Case is created. List<Case> childCases = new List<Case>();for (Case parent : Trigger.new){Case child = new Case (ParentId = parent.Id, Subject = parent.Subject);childCases.add(child);}insert childCases; What happens after the code block executes?

Question83: Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permission for the currently logged-in user while using the custom search tool?

Question84: Requirements state that a child record be to deleted when its parent is deleted, and a child can be moved to a different parent when necessary. Which type of relationship should be built between the parent and child objects in Schema Builder to support these requirements?

Question85: A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple subjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which three statements are useful inside the unit test to effectively test the custom controller?
Choose 3 answers

Question86: What are two use cases for executing Anonymous Apex code? Choose 2 answers

Question87: Which two are true regarding a Dyno? Choose 2 answers

Question88: Which two platform features allow for the use of unsupported languages? Choose 2 answers

Question89: Why would a developer consider using a custom controller over a controller extension?

Question90: What is the data type returned by the following SOSL search? {FIND 'Acme*' in name fields returning account,opportunity};

Question91: Which three resources in a Lightning Component Bundle can contain JavaScript functions? Choose 3

Question92: Which two platform features align to the Controller portion of MVC architecture? (Choose two.)

Question93: A Visual Flow uses an apex Action to provide additional information about multiple Contacts, stored in a custom class, contactInfo. Which is the correct definition of the Apex method that gets additional information?

Question94: A developer is creating a test coverage for a class and needs to insert records to validate functionality. Which method annotation should be used to create records for every method in the test class?

Question95: Which type of code represents the Model in the MVC architecture when using Apex and Visualforce pages?

Question96: A change set deployment from a sandbox to production fails due to a failure in a managed package unit test.
The developer spoke with the manager package owner and they determined it is a false positive and can be ignored. What should the developer do to successfully deploy?

Question97: A developer must create a ShippingCalculator class that cannot be instantiated and must include a working default implementation of a calculate method, that sub-classes can override.
What is the correct implementation of the ShippingCalculator class?

Question98: Which three statements are true regarding trace flags? (Choose three.)

Question99: What must the Controller for a Visulforce page utilized to override the standard Opportunity view button?

Question100: What are two uses for External IDs? (Choose two.)

Question101: A developer can use the debug log to see which three types of information? Choose 3 answers

Question102: A developer wants to display all of the picklist entries for the Opportunity StageName field and all of the available record types for the Opportunity object on a Visualforce page. Which two actions should the developer perform to get the available picklist values and record types in the controller? Choose 2 answers.

Question103: Which two condition cause workflow rules to fire? Choose 2 answers

Question104: Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?

Question105: The Review_c object have a lookup relationship to the job_Application_c object. The job_Application_c object has a master detail relationship up to the position_c object. The relationship is based on the auto populated defaults?
What is the recommended way to display field data from the related Review _C records a Visualforce page for a single Position_c record? Select one of the following:

Question106: Refer to the following Apex code:

What is the value of x when it is written to the debug log?

Question107: A developer has the following code:try {List nameList;Account a;String s = a.Name;nameList.add(s);} catch (ListException le ) {System.debug(' List Exception ');} catch (NullPointerException npe)
{System.debug('
NullPointer Exception ');} catch (Exception e) {System.debug(' Generic Exception ');} What message will be logged?

Question108: Which two strategies should a developer use to avoid hitting governor limits when developing in a multi-tenant environment? (Choose two.)

Question109: Which three data types can a SOQL query return? Choose 3 answers

Question110: A Platform Developer needs to write an Apex method that will only perform an action if a record is assigned to a specific Record Type.
Which two options allow the developer to dynamically determine the ID of the required Record Type by its name? (Choose two.)

Question111: Which set of roll-up types are available when creating a roll-up summary field?

Question112: A developer writes the following code:

What is the result of the debug statement?

Question113: A newly hireddeveloper discovers that there are multiple triggers on the case object.
What should the developer consider when working with triggers?

Question114: A developer must create a ShippingCalculator class that cannot be instantiated and must include a working default implementation of a calculate method, that sub-classes can override. What is the correct implementation of the ShippingCalculator class?

Question115: Which statement about the Lookup Relationship between a Custom Object and a Standard Object is correct?

Question116: A developer needs to create a Visualforce page that displays Case data. The page will be used by both support reps and support managers. The Support Rep profile does not allow visibility of the Customer_Satisfaction__c field, but the Support Manager profile does.
How can the developer create the page to enforce Field Level Security and keep future maintenance to a minimum?

Question117: What should a developer use to script the deployment and unit test execution as part of continuous integration?

Question118: A developer runs the following anonymous code block:List<Account> acc = [SELECT Id FROM Account LIMIT 10];Delete acc;Database.emptyRecycleBin(acc);system.debug(Limits.getDMLStatements()+ ', '
+Limits.getLimitDMLStatements());What is the result?

Question119: What is accurate statement about with sharing keyword? Choose 2 answers

Question120: Which statement is true about developing in a multi-tenant environment?

Question121: How can a developer determine, from the DescribeSObjectResult, if the current user will be able to create records for an object in Apex?

Question122: A team of developers is working on a source-driven project that allows them to work independently, with many different org configurations. Which type of Salesforce orgs should they use for their development?

Question123: To which primitive data type is a text area (rich) field automatically assigned?

Question124: A developer created a Visualforce page and a custom controller with methods to handle different buttons and events that can occur on the page.
What should the developer do to deploy to production?

Question125: A developer working on a time management application wants to make total hours for each timecard available to applications users. A timecard entry has a Master-Detail relationship to a timecard. Which approach should the developer use to accomplish this declaratively?

Question126: A developer must create a ShippingCalculator class that cannot be instantiated and must include a working default implementation of a calculate method, that sub-classes can override.
What is the correct implementation of the ShippingCalculator class?

Question127: If Apex code executes inside the execute()method of an Apex class when implementing the Batchable interface, which two statements are true regarding governor limits? (Choose two.)

Question128: Which tool can deploy destructive changes to Apex classes in production?

Question129: In which three areas can a Lightning component be used in the Lightning Experience? (Choose three.)

Question130: What can be used to override the Account's standard Edit button for Lightning Experience?

Question131: Which two statements are true about using the @testSetup annotation in an Apex test class?
Choose 2 answers

Question132: Which three declarative fields are correctly mapped to variable types in Apex? (Choose three.)

Question133: A developer must create a lightning component that allows users to input contact record information to create a contact record, including a salary__c custom field. what should the developer use, along with a lightning-record-edit form, so that salary__c field functions as a currency input and is only viewable and editable by users that have the correct field levelpermissions on salary__C?

Question134: A developer wants to display all of the picklist entries for the Opportunity StageName field and all of the available record types for the Opportunity object on a Visualforce page. Which two actions should the developer perform to get the available picklist values and record types in the controller? Choose 2 answers.

Question135: A developer is building custom search functionality that uses SOSL to search account and contact records that match search terms provided by the end user. The feature is exposed through a Lightning web component, and the end user is able to provide a list of terms to search.
Consider the following code snippet:

What is the maximum number of search terms the end user can provide to successfully execute the search without exceeding a governor limit?

Question136: Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required?

Question137: An org has an existing Visual Flow that creates an Opportunity with an Update records element. A developer must update the Visual Flow also created a Contact and store the created Contact's ID on the Opportunity.

Question138: Universal Containers requires Service Representatives to update all Cases at least one every three days.
To make sure of this policy is obeyed, a developer has been asked to implement a field that displays the number of days since the last Case update. What should the developer use to configure the solution?

Question139: Which code block returns the ListView of an Account object using the following debug statement? system.debug(controller.getListViewOptions() );

Question140: Universal Container uses Salesforce to create orders.
When an order is created, it needs to sync with the-in-house order fulfillment system. The order fulfillment system can accept SOAP messages over the HTTPS. If the connection fails, messages should be retried for up to 24 hours.
What is the recommended approach to sync the orders in Salesforce with the order fulfillment system?

Question141: A business has a proprietary Order Management System (OMS) that creates orders from their website and fulfills the orders. When the order is created in the OMS, an integration also creates an order record in Salesforce and relates it to the contact as identified by the email on the order. As the order goes through different stages in the OMS, the integration also updates It in Salesforce. It is noticed that each update from the OMS creates a new order record in Salesforce.
Which two actions will prevent the duplicate order records from being created in Salesforce?
Choose 2 answers

Question142: Which exception type cannot be caught ?

Question143: Which three code lines are required to create a Lightning component on a Visualforce page? (Choose three.)

Question144: A developer created these three Rollup Summary fields in the custom object, Project_ct,

The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project.
Which should the developer use to Implement the business requirement in order to minimize maintenance overhead?

Question145: A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Whithin the class, the developer identifies the following method as a security threat: List<Contact> performSearch(String lastName){ return Database.query('Select Id, FirstName, LastName FROM Contact WHERE LastName Like %'+lastName+'%); } What are two ways the developer can update the method to prevent a SOQL injection attack? Choose 2 answers

Question146: A developer wants multiple test classes to use the same set of test data. How should the developer create the test data?

Question147: A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. What step should the developer take to resolve the issue and properly test the exception?

Question148: As a part of class implementation a developer must execute a SOQL query against a large data ser based on the contact object. The method implementation is as follows.

Which two methods are best practice to implement heap size control for the above code? (Choose 2 Answers)